package com.example.demo;

import org.junit.Test;

import java.lang.annotation.Annotation;

public class AnnotationDemo {

    @Child
    public static class Demo {

    }

    public static class ChildDemo extends Demo {

    }

    @Test
    public void test() {
        Class<?> clazz = ChildDemo.class;
        for (Annotation annotation : clazz.getAnnotations()) {
            for (Annotation annotation1 : annotation.annotationType().getAnnotations()) {
                System.out.println(annotation.annotationType());
            }
        }
    }
}
